<template>
  <div id="app">
    <header class="app-header">
      <div class="header-container">
        <div class="logo">
          <img alt="Logo" src="/logo.png" class="logo-img">
          <span class="logo-text">Vue.js App</span>
        </div>
        <nav class="main-nav">
          <router-link to="/" class="nav-link" exact-active-class="active">首页</router-link>
          <router-link to="/about" class="nav-link" exact-active-class="active">关于</router-link>
        </nav>
      </div>
    </header>
    <main class="app-main">
      <router-view/>
    </main>
    <footer class="app-footer">
      <div class="footer-container">
        <p>&copy; 2025 Vue.js 应用. 保留所有权利.</p>
      </div>
    </footer>
  </div>
</template>

<script>
export default {
  name: 'App'
}
</script>

<style lang="scss">
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  width: 40px;
  height: 40px;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #2c3e50;
}

.main-nav {
  display: flex;
  gap: 30px;
}

.nav-link {
  text-decoration: none;
  color: #7f8c8d;
  font-weight: 500;
  transition: color 0.3s ease;
  
  &:hover {
    color: #42b983;
  }
  
  &.active {
    color: #42b983;
  }
}

.app-main {
  flex: 1;
}

.app-footer {
  background-color: #f8f9fa;
  padding: 20px 0;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
  color: #7f8c8d;
}
</style>